﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

namespace SkillSystem
{
    /// <summary>
    /// 技能系统入口
    /// </summary>
    public class SkillSystemFacade : Singleton<SkillSystemFacade>, IInitable,ISkillManager
    {
       

        public void Init()
        {
            skillManager.Init();
        }

        #region 管理器
        ISkillManager skillManager = new SkillManager();


        public SkillData GetSkillDataByID(int id)
        {
           return skillManager.GetSkillDataByID(id);
        }

        public SkillItemData GetSkillItemData(int id)
        {
            return skillManager.GetSkillItemData(id);
        }
        public void RegisterReceiver(ISkillReceiver receiver)
        {
            skillManager.RegisterReceiver(receiver);
        }

        public void RemoveReceiver(ISkillReceiver receiver)
        {
            skillManager.RemoveReceiver(receiver);
        }


        #endregion

        #region 范围计算

        /// <summary>
        /// 计算是否在圆形范围内
        /// </summary>
        /// <param name="centerPos"></param>
        /// <param name="pointPos"></param>
        /// <param name="radius"></param>
        /// <returns></returns>
        public bool IsInScope(Vector3 centerPos,Vector3 pointPos,float radius)
        {
            if (Vector3.Distance(centerPos, pointPos) <= radius)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        #endregion
    }
}
